package com.itranswarp.demo04;

import com.itranswarp.demo02.UserService;
import com.itranswarp.demo02.UserServiceImpl;

public class Client {
    public static void main(String[] args) {
        //真实角色
        UserServiceImpl userService = new UserServiceImpl();

        ProxyInvocationHandler proxyInvocationHandler = new ProxyInvocationHandler();
        //设置代理对象R
        proxyInvocationHandler.setTarget(userService);

        UserService proxy = (UserService)proxyInvocationHandler.getProxy();

        proxy.add();
        proxy.delete();
    }
}
